Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
How do I submit value of a "custom" input in a form?

I'm wirting a CRUD application and I ran into this problem today: There's a form where user can set the entry's priority (basically a number from 1 to 3). But instead of an input with type="number" or anything similar, I created a "custom" input. It's a small circle that changes colors when you click it (colors represent numbers from 1 to 3). My question is: how do I submit this value to the form?

The solution I came up with was to use an input with type="hidden" and before the form is submitted, javascript changes the input's "value" attribute to match the number selected in the "custom" input. This seems to be working but according to MDN type="hidden" inputs are used for "data that cannot be seen or modified by users when a form is submitted", so I'm guessing this is not a typical solution to this kind of problem. Is there some kind of agreed upon method for this problmes like this?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda